home *** CD-ROM | disk | FTP | other *** search
- #include "/xsb.h"
-
- struct GfxBase *GfxBase;
- struct IntuitionBase *IntuitionBase;
-
- #define rnd(x) (rand()%(x))
-
- void srand(int);
- int rand(void);
-
- struct XSBPref defpref;
- extern struct Custom __far custom;
-
- void __saveds XSBBlankScreen(long signum,struct XSBInfo *xsbi)
- {
- struct RastPort *rp;
- struct ViewPort *vp;
- struct Screen *scr;
- struct timerequest *tr=xsbi->tr;
- struct XSBPref *pref=xsbi->prefs;
-
- defpref.xsb_arg=10;
- if(pref) defpref=*pref;
-
- srand(scr);
- GfxBase=OldOpenLibrary("graphics.library");
- IntuitionBase=OldOpenLibrary("intuition.library");
-
- if(scr=OpenScreenTags(0,SA_Width,320,SA_Height,256,
- SA_DisplayID,LORES_KEY,
- SA_Type,CUSTOMSCREEN|SCREENQUIET,
- SA_Quiet,TRUE,
- SA_Depth,4,
- TAG_DONE))
- {
- custom.dmacon=(1<<5);
- rp=&scr->RastPort;
- vp=&scr->ViewPort;
- while(!(SetSignal(0,signum)&signum)) {
- SetRGB4(vp,rnd(15),rnd(15),rnd(15),rnd(15));
- SetAPen(rp,rnd(15));
- switch(rnd(7)) {
- case 0:
- case 1:
- case 2: WritePixel(rp,rnd(320),rnd(256)); break;
- case 3:
- case 4: Move(rp,rnd(320),rnd(256)); Draw(rp,rnd(320),rnd(256)); break;
- case 5: DrawEllipse(rp,90+rnd(140),60+rnd(80),3+rnd(83),3+rnd(52)); break;
- case 6: RectFill(rp,rnd(160),rnd(128),160+rnd(320),128+rnd(128)); break;
- }
- tr->tr_node.io_Command=TR_ADDREQUEST;
- tr->tr_time.tv_secs=0;
- tr->tr_time.tv_micro=defpref.xsb_arg*10;
- DoIO(tr);
- }
- CloseScreen(scr);
- }
- CloseLibrary(GfxBase);
- CloseLibrary(IntuitionBase);
- }
-
- char * __saveds XSBGetID(void)
- {
- return("XSB Psychedelic Blanker\n\nGives some more or less\nnice psychedelic effects.");
- }
- char *cyl[]={"Sel1","Sel2","Sel3","Sel4",0};
-
- struct XSBPref defpref4;
- struct XSBPref defpref3;
- struct XSBPref defpref2;
- struct XSBPref defpref1;
-
- struct XSBParams parm4={0,XSBP_STRING,"String:",0,0,0,&defpref4};
- struct XSBParams parm3={&parm4,XSBP_BOOL,"Checkbox:",0,0,0,&defpref3};
- struct XSBParams parm2={&parm3,XSBP_INTEGER,"Int:",0,0,0,&defpref2};
- struct XSBParams parm1={&parm2,XSBP_CYCLE,"Cycle:",cyl,0,0,&defpref1};
- struct XSBParams parm={&parm1,XSBP_SLIDER,"Speed:",0,1,99,&defpref};
-
-
- struct XSBParams * __saveds XSBGetParams(void)
- {
- defpref1.xsb_arg=2;
- defpref2.xsb_arg=4242;
- defpref3.xsb_arg=5;
- strcpy(defpref4.xsb_string,"Teststring");
- return(&parm);
- }
-